package hao.d02;

public class Student implements Comparable<Student>{
    private int id;
    private String name;
    private int scroce;

    public Student(int id, String name, int scroce) {
        this.id = id;
        this.name = name;
        this.scroce = scroce;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getScroce() {
        return scroce;
    }

    public void setScroce(int scroce) {
        this.scroce = scroce;
    }

    @Override
    public int compareTo(Student o) {
        if (this.scroce>o.scroce){
            return 1;
        }else if (this.scroce<o.scroce){
            return -1;
        }else {
            return 0;
        }
    }
}

